package com.my.chapter9;

public class practice4 {
    static void test(P04 p){
        System.out.print("P04.test(): ");
        ((P04A)p).display();
    }
    static void test1(P041 p){
        System.out.print("P041.test1(): ");
        p.f();
    }
    public static void main(String[] args) {
        P04A p1 = new P04A();
        P04A1 p2 = new P04A1();
        test(p1);
        test1(p2);
    }
}

abstract class P04{

}

class P04A extends P04{
    public void display(){
        System.out.println("P04A.display()");
    }
}

abstract class P041{
    abstract void f();
}

class P04A1 extends P041{

    @Override
    void f() {
        System.out.println("P04A1.f()");
    }
}

